package com.portal4kids.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "people_attributes")
public class PeopleAttributes implements Serializable{
	private int id_attributes;
	private People people;
	
	//Doctors
	private String D_A1 = "NIE";
	private String specialization = "none";
	
	//Babysitter
	private String B_A1 = "none";
	private String B_A2 = "none";
	
	
	@Id
    @GeneratedValue
	public int getId_attributes() {
		return id_attributes;
	}
	public void setId_attributes(int id_attributes) {
		this.id_attributes = id_attributes;
	}
	
	@ManyToOne
	@JoinColumn(name="id_people")
	public People getPeople() {
		return people;
	}
	public void setPeople(People people) {
		this.people = people;
	}
	public String getD_A1() {
		return D_A1;
	}
	public void setD_A1(String d_A1) {
		D_A1 = d_A1;
	}
	public String getSpecialization() {
		return specialization;
	}
	public void setSpecialization(String specialization) {
		this.specialization = specialization;
	}
	public String getB_A1() {
		return B_A1;
	}
	public void setB_A1(String b_A1) {
		B_A1 = b_A1;
	}
	public String getB_A2() {
		return B_A2;
	}
	public void setB_A2(String b_A2) {
		B_A2 = b_A2;
	}
	
	public List<String> getAttributeAfterType(String type){
		List<String> list = new ArrayList<String>();
		if("Lekarze".equals(type)){
			list.add(getD_A1());
			list.add(getSpecialization());
		}else if("Opiekunki do dzieci".equals(type)){
			list.add(getB_A1());
			list.add(getB_A2());
		}
		return list;
	}
	
	@Override
	public String toString() {
		return "PeopleAttributes [id_attributes=" + id_attributes + ", people="
				+ people + ", D_A1=" + D_A1 + ", specialization="
				+ specialization + ", B_A1=" + B_A1 + ", B_A2=" + B_A2 + "]";
	}
	
	

}
